package com.hht.kotlineee

import kotlinx.coroutines.*
import org.junit.Test

class CoroutineTest02 {
    @Test
    fun test_scope_cancel() {
        runBlocking {
           val scope = CoroutineScope(Dispatchers.Default)
           scope.launch {
               delay(1000)
                println("job1")
            }
            scope.launch {
                delay(1000)
                println("job2")
            }
            delay(500)
            scope.cancel()
            delay(2000)
        }
    }
}